<script setup>




</script>
<template>
<div class="container">
    <div class="one-block">
        <div class="title">第一个标题</div>
        <div class="content">第一个内容</div>
    </div>
    <div class="one-block">
        <div class="title">第二个标题</div>
        <div class="content">第二个内容</div>
    </div>
    <div class="one-block">
        <div class="title">第三个标题</div>
        <div class="content">第三个内容</div>
    </div>
</div>


</template>
<style scoped>
.container{
    width: 200px;
    height: 500px;
    border: 1px solid black;
    overflow-y: scroll;

}
.one-block{
    width: 100%;
}
.title{
    position: sticky;
    top: 0px;
    background-color: rgb(199, 199, 199);
    font-size: 2rem;
}

.content{
    background-color: antiquewhite;
    height: 600px;
    font-size: 3rm;
    color: black;
}
</style>